package com.Glow.reggie.service.impl;

import com.Glow.reggie.service.EmailSenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

/**
 * @Author Glow
 * @Date 2022-08-05 14:14:26
 * @Description
 * @Version 1.0
 */
@Service
public class EmailSenderServiceImpl implements EmailSenderService {
    @Autowired
    private JavaMailSender javaMailSender;
    @Override
    public void contextLoads(String code, String email) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setText("顾客您好，您的验证码是："+code);
        message.setSubject("欢迎登录咱平台，您的验证码如下：");
        message.setTo(email);
//        message.setCc("抄送人");
//        message.setBcc("密送人");
        message.setFrom("654763560@qq.com");
        javaMailSender.send(message);

    }
}
